package com.ruoyi.iot.service.impl;

import com.ruoyi.iot.mapper.CameraMapper;
import com.ruoyi.iot.service.CameraService;
import com.ruoyi.iot.vo.CameraVO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.time.Instant;
import java.util.Collections;
import java.util.List;

@Service
@RequiredArgsConstructor
public class CameraServiceImpl implements CameraService {

    private final CameraMapper cameraMapper;

    @Override
    public List<CameraVO> get(String sensorId, Instant startTime, Instant endTime) {
        return cameraMapper.get(sensorId, startTime, endTime);
    }

    @Override
    public CameraVO getNew(String sensorId) {
        return cameraMapper.getNew(sensorId);
    }

    @Override
    public List<CameraVO> getRange(String sensorId, Integer targetPoints, Instant startTime, Instant endTime) {
        return cameraMapper.getRange(sensorId, targetPoints, startTime, endTime);
    }
}
